<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        html {
            height: 100%;
        }
        body {
            height: 100%;
        }
        .container {
            height: 100%;
        }
        .btn {
            text-align: center;
            padding: 10px;
            width: 100%;
            margin-top: 40px;
            background-image: linear-gradient(to right, #a6c1ee, #fbc2eb);
            color: #fff;
        }
    </style>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script type="text/javascript">
       function formsb(){
           let temp= fileStr($('#str').val());
           console.log(temp)
           document.getElementById('str').value= temp;
           document.fm.submit();
       }

       function fileStr(s){
           let temp = s.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\t/g,"").replace(/\s/g,"");
           return temp;
       }

    </script>
</head>
<body>
<div class="container">
        <br/>
        <br/>
    <div class="login-wrapper" align="center">
        <form name="fm" action="/toSign" method="post" style="align-content: center">
        <div class="header" align="center">Json 字符串</div>
        <div class="form-wrapper">
            <table>

                <tr>
                    <td>
                        <textarea id="str" th:utext="${str}" name="str" style="width: 600px;height: 500px;overflow-y:auto" ></textarea>
                    </td>
                    <td>
                        <textarea th:utext="${sign}" name="sign" style="width: 600px;height: 500px;overflow-y: auto" ></textarea>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input name="secret" placeholder="请输入渠道的secret" style="width: 1000px;height:50px; border: 2px; outline: 2px dashed aquamarine;" th:value="${secret}">
                    </td>
                </tr>
            </table>

            <div class="btn" onclick="formsb()">压缩并生成Sign</div>
        </div>
        </form>
    </div>

</div>
</body>
</html>
